<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="static/lib.js"></script>
<script type="text/javascript" src="static/lib.ext.js"></script>
<script type="text/javascript" src="static/engine.js"></script>
<style type="text/css">
.ff0000{ border:#FF0000 solid 1px;}
</style>
</head>

<body  id="rrrr">
<div>
<input type="text" id="eInShow" size="600" />
<input type="submit" name="button" value="提交" onclick="showEl();" id="btnshow" />
</div>

<div onclick="__xyp_dom_get__.click()">
	
    <ul>
        <li>1
          <label for="textfield">ddd</label>
          <input type="text" name="textfield"  value="ddd" />
        </li>
        <li>2</li>
    </ul>
    <form id="form1" name="form1" method="post" action="">
      <label for="textarea"></label>
      <textarea name="textarea" id="textarea" cols="45" rows="5"></textarea>
    </form><p>&nbsp;</p>
   
    <iframe src="untitled2.html" width="5000" height="300"></iframe>
    
<ul>
      <li>3</li>
    </ul>
</div>
</body>
<script type="text/javascript">
var btnShow = document.getElementById("eInShow");
var __xyp_dom_get__ =
{
	root:'document.body',
	
	
	
	click:function(ev)
	{
		ev = ev || window.event;
		if(top.location != self.location)
		{
			window.top.getEleStation(ev);
		}else if(ev)
		{
			this.focus(ev);
			var el = "document.body."+this.Doc2Ele(ev.srcElement);
			btnShow.value=el;		
		}
		return false;
	},
	focus:function(ev)
	{
		style = ev.srcElement.style;
		style.border	= '1px';
		style.borderStyle = 'solid';
		style.borderColor = '#ff0000';
	},
	Doc2Ele:function(pre,src)
	{
		src = src || pre;
		pre = pre == src ? this.root : pre || this.root;
		var oList = [],o=null;
		if(o = pre.firstChild)
		{
			oList.push(o);
			while(o = o.nextSibling)
				oList.push(o);
		}
		var i = 0,cnt = oList.length,rs = false;
		//alert(cnt);
		///for(i in oList) alert(i);
		for(i = 0;i<cnt;i++)
		{
			o = oList[i];
			//alert(oList[i].tagName+'|'+oList[i].nodeType);
			if(o == src)
			{
				return 'childNodes['+i+']';
				//return [o,i,'childNodes['+i+']'];	
			}else if(o.tagName && o.hasChildNodes())
			{
				if(rs = this.Doc2Ele(o,src))
				{
					return 'childNodes['+i+'].'+rs;
				}
			}else if(o.tagName && o.tagName == "FRAME" || o.tagName == "IFRAME")
			{
				if(rs = this.Doc2Ele(o.contentWindow.document.body,src))
				{
					return 'childNodes['+i+'].contentWindow.document.body.'+rs;
				}
			}
		}
		return false;
	}
}
var showEl = function()
{
	alert("innerHTML:"+eval(btnShow.value).innerHTML+"\n"
			+"value:"+eval(btnShow.value).value+"\n"
			+"tagName:"+eval(btnShow.value).tagName+"\n");
}

//btnShow.disabled=true;
//alert(btnShow.nodeType); 
//alert(btnShow.hasChildNodes());
//alert(btnShow.nextSibling.nodeType);
//alert(btnShow.parentNode.tagName);
//alert(document.childNodes[1].tagName);
//alert(document.childNodes[1].childNodes[1].childNodes[1].childNodes[5].contentWindow.document.childNodes[1].childNodes[1].childNodes[1].childNodes[2].childNodes[0].childNodes[2].value)
//var tt= document.childNodes[1].childNodes[1].childNodes[1].childNodes[5];
//alert(document.childNodes[1].childNodes[1].childNodes[1].childNodes[5].tag6Name());
//alert(document.childNodes[1].childNodes[1].childNodes[1].childNodes[5].Document.childNodes[1].childNodes[1].childNodes[1].childNodes[2].childNodes[0].childNodes[2].value);
//alert(document.childNodes[1].childNodes[1].childNodes[1].childNodes[2].childNodes[0].childNodes[2].value);
//alert(document.childNodes[1].childNodes[1].childNodes[1].childNodes[2].childNodes[0].childNodes[2].value);
//alert(document.body.childNodes.item(1).childNodes.item(2).childNodes.item(1).innerHTML);
</script>
<textarea name="textarea" id="dddddd" cols="10" rows="2"></textarea>
</html>